home *** CD-ROM | disk | FTP | other *** search
/ Light / Light_Vol.1_August_1992_Datasphere_Publications_Disk_1_of_2_Side_A.d64 / sprite scanner (.txt) < prev    next >
Commodore BASIC  |  2023-02-26  |  6KB  |  248 lines

  1. 0 rem 1991 andrew mayor for c64 light
  2. 5 if fre(1)<>fre(0) then print "[147]c64 mode only":end
  3. 10 a=a+1:onagoto15 ,30,40
  4. 15 poke 53280,06:poke 53281,15:print"[155][147]"
  5. 20 poke 53281,6
  6. 25 load"m/c scan1",8,1
  7. 30 load"m/c scan2",8,1
  8. 40 wait 56320,16,16
  9. 45 poke 1018,122:poke1019,242:poke 756,3
  10. 50 loc=1472:poke 1014,64:poke1015,8
  11. 55 poke 254,int(loc/256):poke 253,loc-(peek(254)*256)
  12. 60 print"[147]":poke53280,0:poke 53281,0
  13. 65 dim vl(5):dim mx(5):dim b$(7):dim byt(7):dim cl(3):dim irq(4,1)
  14. 70 set=2
  15. 75 for x=0 to 4:readvl(x):readmx(x):next
  16. 80 forx=0 to 7:read b$(x):nextx
  17. 85 forx=0to4:read irq(x,0):read irq(x,1):next
  18. 90 for x=0 to 7:byte(x)=2^x:next:rem bytes for speed
  19. 95 gosub865:goto 1195
  20. 100 print "[147][154]      [159]--  sprite memory scanner  --"
  21. 105 print"[155]";
  22. 110 print"back  = "tab(13)"[146][217][144] [146][212][155]"tab(19)"multi mode  ="
  23. 115 print"mcol1 = "tab(13)"[146][217][144] [146][212][155]"tab(19)"bump"spc(8)"="
  24. 120 print"mcol2 = "tab(13)"[146][217][144] [146][212][155]"
  25. 125 rem *show values*
  26. 130 print"[154]    ":sys 953:rem spr info show
  27. 135 for s1=0 to 4:gosub140:next:return
  28. 140 poke 55470+(s1*20),vl(s1)
  29. 145 print""
  30. 150 poke 214,4+int(s1/2):poke 211,8+(s1and1)*25
  31. 155 sys 58732:rem print#
  32. 160 poke 199,rev:rev=0
  33. 165 if s1=1 then print b$(0);b$(vl(1)+3):return
  34. 170 print b$(0);vl(s1)
  35. 175 return
  36. 180 s1=0:max=4
  37. 185 rev=1:gosub140
  38. 190 nm=s1:gosub720:
  39. 195 if s1<>nm then rev=0:gosub140:s1=nm
  40. 200 if fire=1 then230
  41. 205 if g = 30 then vl(s1)=vl(s1)+1
  42. 210 if g=29 then vl(s1)=vl(s1)-1
  43. 215 if vl(s1) < 0 then vl(s1)=mx(s1)
  44. 220 if vl(s1) > mx(s1) then vl(s1)=0
  45. 225 goto185
  46. 230 poke v+28,255*vl(1):poke v+37,vl(2):pokev+38,vl(4)
  47. 235 poke 251,(peek(251)and192)+vl(3)
  48. 240 gosub125:gosub330
  49. 245 goto250
  50. 250 wait 56320,16,0
  51. 255 print b$(7)"[151]   ";
  52. 260 if set=0 then print"[152]";
  53. 265 print" settings [151]";
  54. 270 if set=1 then print"[152]";
  55. 275 print" scan [151]";
  56. 280 if set=2 then print"[152]";
  57. 285 print" disk [151]";
  58. 290 if set=3 then print"[152]";
  59. 295 print" move [151]";
  60. 300 if set=4 then print"[152]";
  61. 305 print" zoom [151]   ";
  62. 310 max=4
  63. 315 nm=set:gosub720:set=nm
  64. 320 if fire=1 then on set+1 goto180,915,365,785,540
  65. 325 goto255
  66. 330 rem *backgrnd*
  67. 335 printb$(7)"";
  68. 340 poke 646,vl(0):poke1017,vl(0)
  69. 345 for g=1 to 15
  70. 350 print"                                        ";
  71. 355 next g
  72. 360 return
  73. 365 rem *disk*
  74. 370 wait 56320,16,0
  75. 375 nm=0:max=2:print"[154]"
  76. 380 printb$(7)"    ";
  77. 385 if nm=0 then print"[159]";
  78. 390 print"   load   ";
  79. 395 if nm=1 then print"[159]";
  80. 400 print"   save   ";
  81. 405 if nm=2 then print"[159]";
  82. 410 print"   cancel       ";
  83. 415 gosub720
  84. 420 ls=nm
  85. 425 if fire=1 then on nm+1 goto435,500,250
  86. 430 goto380
  87. 435 rem *load*
  88. 440 wait 56320,16,0
  89. 445 max=1:nm=0:fire=0
  90. 450 print"":gosub1065:print"[154] new load address ? :[159] ";b$(nm+5)
  91. 455 if fire=1 then on nm+1 goto465,475
  92. 460 gosub720:goto450
  93. 465 print"":gosub1065
  94. 470 print"[153] load: ";:gosub965
  95. 475 gosub1080
  96. 480 poke 195,l1:poke 196,h1
  97. 485 poke 186,8:poke 185,nm
  98. 490 sys 934
  99. 495 goto 1195
  100. 500 rem *save*
  101. 505 print"":gosub1065
  102. 510 print"[153] save: ";:gosub990
  103. 515 gosub1080
  104. 520 poke193,l1:poke 194,h1:poke 174,(l2+1)and255:poke175,(h2+(1-sgn(l2)))and255
  105. 525 poke186,8:poke185,0
  106. 530 sys 934
  107. 535 goto 1195
  108. 540 rem *zoom*
  109. 545 wait 56320,16,0
  110. 550 max=7:x=4:fire=0:goto 565
  111. 555 nm=jj:gosub720:jj=nm
  112. 560 poke 56255+x,0:poke 1983+x,160
  113. 565 x=int((jj+1)*40/9)
  114. 570 poke1983+x,30 :poke 56255+x,3
  115. 575 if fire<>1 then555
  116. 580 gosub 1155:rem irqoff
  117. 585 if jj<>7then for x= 1 to (7-jj):sys920:nextx
  118. 590 pokev+21,0:cl(0)=vl(0):cl(1)=vl(2):cl(3)=vl(4):md=vl(1)+1
  119. 595 cl(2)=peek(53287+jj)
  120. 600 poke 53296,1:rem c128 2mhz
  121. 605 print"[144][147]";:sys820
  122. 610 print"[146]"spc(6)"sprite zoom"
  123. 615 poke 646,cl(0)
  124. 620 for g=1 to 21:print b$(md ):next
  125. 625 for l=0 to 2:for g=0 to 20
  126. 630 x=peek(loc +(64*7)+l+g*3)
  127. 635 if x=0 then goto660
  128. 640 t=l*8+g*40
  129. 645 for m=0 to 7 step md
  130. 650 on md gosub690,705
  131. 655 nextm
  132. 660 nextg:nextl
  133. 665 poke 53296,0:rem 2mhz off
  134. 670 wait 56320,16,16
  135. 675 if jj<>7 then forx=1to(7-jj):sys906:nextx
  136. 680 goto 1195
  137. 685 rem *hi-res*
  138. 690 if sgn(xandbyt(m))=1 then poke (55336+7-m+t),cl(2)
  139. 695 return
  140. 700 rem *multi *
  141. 705 n=(xand(byt(m)+byt(m+1)))/byt(m)
  142. 710 poke(55335+7-m+t),cl(n):poke(55336+7-m+t),cl(n)
  143. 715 return
  144. 720 rem *joystick*
  145. 725 g=peek(56320)and31:if g=31 then geta$:if a$="" then 725
  146. 730 if g=31 goto765
  147. 735 if g=23 then nm=nm+1
  148. 740 if g=27 then nm=nm-1
  149. 745 if nm<0 then nm=0
  150. 750 if nm>max then nm=max
  151. 755 fire=0:if g=15 then fire=1
  152. 760 return
  153. 765 if a$<"1" or a$>"8" then goto 780
  154. 770 g=v+39+val(a$)-1
  155. 775 poke g,peek(g)+1and15
  156. 780 goto 725
  157. 785 rem *move*
  158. 790 print"[129]":gosub1065
  159. 795 print"[158] move: [129]";:gosub990
  160. 800 ln=(l2+(h2*256)+1-(l1+(h1*256)))/64
  161. 805 if ln>255 then print" [150] too big !!!":wait56320,16,16:goto785
  162. 810 l2=l1:h2=h1
  163. 815 gosub965
  164. 820 gosub 1155:rem irqoff
  165. 825 poke 253,l1:poke254,h1
  166. 830 poke 251,l2:poke252,h2
  167. 835 poke 1015,ln
  168. 840 sys 820:rem copy sprite
  169. 845 poke 251,l1:poke252,h1
  170. 850 poke 1015,8:poke 254,int(loc/256):poke 253,loc-(peek(254)*256)
  171. 855 gosub 1145:goto250
  172. 860 rem *spr set*
  173. 865 g=0:dist=37
  174. 870 v=53248:poke v+21,255:poke v+16,192
  175. 875 for x=v+39 to v+46:g=g+1:pokex,g+6:next:g=0
  176. 880 for x=v to v+15 step 2:g=g+dist
  177. 885 poke x,(gand255):poke x+1,180
  178. 890 next
  179. 895 poke v+29,0:poke v+23,0:pokev+28,0
  180. 900 poke 251,00:poke 252,32:rem $2000
  181. 905 for x=0 to 7:poke 2040+x,loc/64+x:next x
  182. 910 return
  183. 915 rem *scan*
  184. 920 gosub925:goto250
  185. 925 wait 56320,16,0
  186. 930 poke 1986,158
  187. 935 sys 953 :rem mem loc
  188. 940 g=peek(56320)and31:if g=31then poke 56258,peek(56258)+1and255:goto940
  189. 945 if g = 15 then poke 56258,0:poke1986,160:return
  190. 950 if g = 23 then sys 906  :rem mc add
  191. 955 if g = 27 then sys 920  :rem mc sub
  192. 960 goto935
  193. 965 rem *get 1 loc*
  194. 970 print" to ";
  195. 975 gosub925:gosub1045
  196. 980 l1=peek(251):h1=peek(252)
  197. 985 return
  198. 990 rem *get 2 loc*
  199. 995 print" from ";
  200. 1000 gosub925:gosub1045
  201. 1005 l1=peek(251):h1=peek(252)
  202. 1010 print" - ";
  203. 1015 gosub925:gosub1045
  204. 1020 print">";
  205. 1025 l2=peek(251):h2=peek(252)
  206. 1030 if ((h1*256)+l1)>((h2*256)+l2) then l2=l1:h2=h1:l1=peek(251):h1=peek(252)
  207. 1035 h2=h2+sgn((l2+63)and256):l2=(l2+63)and 255
  208. 1040 return
  209. 1045 rem *print loc*
  210. 1050 for x=1024 to 1027:temp=peek(x)
  211. 1055 temp=temp-128:if temp<48 then temp=temp+64
  212. 1060 printchr$(temp);:nextx:return
  213. 1065 rem *print bar*
  214. 1070 print b$(7)"                                        "
  215. 1075 print"[145][145]";:return
  216. 1080 rem *filename*
  217. 1085 poke v+21,0
  218. 1090 gosub 1155:rem irqoff
  219. 1095 print"[146][144][147][155]"tab(11)"................"
  220. 1100 input"file name";nm$
  221. 1105 nm$=left$(nm$,16)
  222. 1110 forx=1tolen(nm$)
  223. 1115 poke 1983+x,asc (mid$(nm$,x,1))
  224. 1120 nextx
  225. 1125 poke 183,len(nm$)
  226. 1130 poke 187,192:poke 188,7
  227. 1135 poke 951,48 +(ls*2)
  228. 1140 return
  229. 1145 rem *irqon*
  230. 1150 mode=0:goto 1165
  231. 1155 rem *irqoff*
  232. 1160 mode=1
  233. 1165 for x=0 to 4
  234. 1170 poke 681+(x*5),irq(x,mode)
  235. 1175 next
  236. 1180 sys 679
  237. 1185 poke 53281,0
  238. 1190 return
  239. 1195 rem *reset*
  240. 1200 print"[147]":gosub100:gosub330
  241. 1205 pokev+21,255
  242. 1210 gosub 1145:rem irqon
  243. 1215 goto 250
  244. 1220 data 15,15,0,1,0,15,0,63,1,15
  245. 1225 data "   [157][157][157]","[208][208][208][208][208][208][208][208][208][208][208][208][208][208][208][208][208][208][208][208][208][208][208][208]","[207][208][207][208][207][208][207][208][207][208][207][208][207][208][207][208][207][208][207][208][207][208][207][208]"
  246. 1230 data off,on ,yes,no ,""
  247. 1235 data 205,49,2,234,249,01,01,240,01,121
  248.